#-*- coding:utf-8 -*-
import string
import sys
from itertools import permutations
#输入生成多少位的字典
passwd_place=int(sys.argv[1])
print passwd_place
#字符集列表
passwd_numb=[]
str_numb=string.ascii_letters
for str_n in str_numb:
	passwd_numb.append(str_n)
for numb in range(0,10):
	passwd_numb.append(str(numb))
print passwd_numb

passwd_file=open('password.txt','a')
passwd_list=list(permutations(passwd_numb,passwd_place))
for jg in passwd_list:
	a=''.join(jg)
	passwd_file.write(a+'\n')

passwd_file.close()